package com.caiheng.api.service.attendance;

import com.caiheng.api.entity.attendance.Attendance;
import com.caiheng.api.entity.attendance.AttendanceGroup;
import com.caiheng.api.entity.attendance.AttendanceGroupUser;
import com.caiheng.api.entity.sys.SysUser;
import com.caiheng.api.entity.wxuser.User;
import com.caiheng.api.service.base.BaseService;

import java.util.Map;

/**
 * 考勤Service接口
 *
 * @author ruoyi
 * @date 2022-09-19
 */
public interface AttendanceService extends BaseService<Attendance> {

    /**
     *  判断是否已经打卡
     * @param user
     * @param groupUser
     * @param type
     * @return
     */
    boolean isCheckAttendance(User user, AttendanceGroupUser groupUser, int type);

    /**
     *  添加打卡记录
     * @param attendance
     * @return
     */
    int addCheck(Attendance attendance);

    /**
     *  查询当月请假天数
     * @param map
     * @return
     */
    Double getLeaveDaysByUserId(Map<String,Object> map);

    /**
     *  请假
     * @param leaveType 请假类型
     * @param leaveBeginDate 请假开始日期
     * @param leaveBeginTime 请假开始时间
     * @param leaveEndDate 请假结束日期
     * @param leaveEndTime 请假结束时间
     * @param remark 请假理由
     * @param leaveTime  请假天数
     * @param imgs
     * @return
     */
    int addLeave(User user, SysUser sysUser,String leaveType,String leaveBeginDate, String leaveBeginTime, String leaveEndDate, String leaveEndTime, String remark, double leaveTime,String imgs);

    /**
     *  获取考勤记录
     * @param attendanceGroup
     * @param user
     * @param type  0 - 上午 1 - 下午
     * @return
     */
    Attendance getTodayAttendance(AttendanceGroup attendanceGroup, User user, int type);
}
